
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>django.db.models.functions.math &#8212; Django 2.2.12.dev20200304094918 documentation</title>
    <link rel="stylesheet" href="../../../../../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../../../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript" id="documentation_options" data-url_root="../../../../../" src="../../../../../_static/documentation_options.js"></script>
    <script type="text/javascript" src="../../../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../../../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../../../../_static/language_data.js"></script>
    <link rel="index" title="Index" href="../../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../../search.html" />



 
<script type="text/javascript" src="../../../../../templatebuiltins.js"></script>
<script type="text/javascript">
(function($) {
    if (!django_template_builtins) {
       // templatebuiltins.js missing, do nothing.
       return;
    }
    $(document).ready(function() {
        // Hyperlink Django template tags and filters
        var base = "../../../../../ref/templates/builtins.html";
        if (base == "#") {
            // Special case for builtins.html itself
            base = "";
        }
        // Tags are keywords, class '.k'
        $("div.highlight\\-html\\+django span.k").each(function(i, elem) {
             var tagname = $(elem).text();
             if ($.inArray(tagname, django_template_builtins.ttags) != -1) {
                 var fragment = tagname.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>");
             }
        });
        // Filters are functions, class '.nf'
        $("div.highlight\\-html\\+django span.nf").each(function(i, elem) {
             var filtername = $(elem).text();
             if ($.inArray(filtername, django_template_builtins.tfilters) != -1) {
                 var fragment = filtername.replace(/_/, '-');
                 $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>");
             }
        });
    });
})(jQuery);</script>

  </head><body>

    <div class="document">
  <div id="custom-doc" class="yui-t6">
    <div id="hd">
      <h1><a href="../../../../../index.html">Django 2.2.12.dev20200304094918 documentation</a></h1>
      <div id="global-nav">
        <a title="Home page" href="../../../../../index.html">Home</a>  |
        <a title="Table of contents" href="../../../../../contents.html">Table of contents</a>  |
        <a title="Global index" href="../../../../../genindex.html">Index</a>  |
        <a title="Module index" href="../../../../../py-modindex.html">Modules</a>
      </div>
      <div class="nav">
    <a href="../../../../index.html" title="Module code" accesskey="U">up</a></div>
    </div>

    <div id="bd">
      <div id="yui-main">
        <div class="yui-b">
          <div class="yui-g" id="_modules-django-db-models-functions-math">
            
  <h1>Source code for django.db.models.functions.math</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">math</span>

<span class="kn">from</span> <span class="nn">django.db.models.expressions</span> <span class="k">import</span> <span class="n">Func</span>
<span class="kn">from</span> <span class="nn">django.db.models.fields</span> <span class="k">import</span> <span class="n">FloatField</span><span class="p">,</span> <span class="n">IntegerField</span>
<span class="kn">from</span> <span class="nn">django.db.models.functions</span> <span class="k">import</span> <span class="n">Cast</span>
<span class="kn">from</span> <span class="nn">django.db.models.functions.mixins</span> <span class="k">import</span> <span class="p">(</span>
    <span class="n">FixDecimalInputMixin</span><span class="p">,</span> <span class="n">NumericOutputFieldMixin</span><span class="p">,</span>
<span class="p">)</span>
<span class="kn">from</span> <span class="nn">django.db.models.lookups</span> <span class="k">import</span> <span class="n">Transform</span>


<div class="viewcode-block" id="Abs"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Abs">[docs]</a><span class="k">class</span> <span class="nc">Abs</span><span class="p">(</span><span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;ABS&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;abs&#39;</span></div>


<div class="viewcode-block" id="ACos"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.ACos">[docs]</a><span class="k">class</span> <span class="nc">ACos</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;ACOS&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;acos&#39;</span></div>


<div class="viewcode-block" id="ASin"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.ASin">[docs]</a><span class="k">class</span> <span class="nc">ASin</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;ASIN&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;asin&#39;</span></div>


<div class="viewcode-block" id="ATan"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.ATan">[docs]</a><span class="k">class</span> <span class="nc">ATan</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;ATAN&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;atan&#39;</span></div>


<div class="viewcode-block" id="ATan2"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.ATan2">[docs]</a><span class="k">class</span> <span class="nc">ATan2</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;ATAN2&#39;</span>
    <span class="n">arity</span> <span class="o">=</span> <span class="mi">2</span>

    <span class="k">def</span> <span class="nf">as_sqlite</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">connection</span><span class="o">.</span><span class="n">ops</span><span class="p">,</span> <span class="s1">&#39;spatialite&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">)</span> <span class="ow">or</span> <span class="ow">not</span> <span class="p">(</span>
            <span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&lt;=</span> <span class="n">connection</span><span class="o">.</span><span class="n">ops</span><span class="o">.</span><span class="n">spatial_version</span> <span class="o">&lt;</span> <span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
        <span class="p">):</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">)</span>
        <span class="c1"># This function is usually ATan2(y, x), returning the inverse tangent</span>
        <span class="c1"># of y / x, but it&#39;s ATan2(x, y) on SpatiaLite &gt;= 4.3.0, &lt; 5.0.0.</span>
        <span class="c1"># Cast integers to float to avoid inconsistent/buggy behavior if the</span>
        <span class="c1"># arguments are mixed between integer and float or decimal.</span>
        <span class="c1"># https://www.gaia-gis.it/fossil/libspatialite/tktview?name=0f72cca3a2</span>
        <span class="n">clone</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
        <span class="n">clone</span><span class="o">.</span><span class="n">set_source_expressions</span><span class="p">([</span>
            <span class="n">Cast</span><span class="p">(</span><span class="n">expression</span><span class="p">,</span> <span class="n">FloatField</span><span class="p">())</span> <span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">expression</span><span class="o">.</span><span class="n">output_field</span><span class="p">,</span> <span class="n">IntegerField</span><span class="p">)</span>
            <span class="k">else</span> <span class="n">expression</span> <span class="k">for</span> <span class="n">expression</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">get_source_expressions</span><span class="p">()[::</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>
        <span class="p">])</span>
        <span class="k">return</span> <span class="n">clone</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">)</span></div>


<div class="viewcode-block" id="Ceil"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Ceil">[docs]</a><span class="k">class</span> <span class="nc">Ceil</span><span class="p">(</span><span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;CEILING&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;ceil&#39;</span>

    <span class="k">def</span> <span class="nf">as_oracle</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="n">function</span><span class="o">=</span><span class="s1">&#39;CEIL&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">)</span></div>


<div class="viewcode-block" id="Cos"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Cos">[docs]</a><span class="k">class</span> <span class="nc">Cos</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;COS&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;cos&#39;</span></div>


<div class="viewcode-block" id="Cot"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Cot">[docs]</a><span class="k">class</span> <span class="nc">Cot</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;COT&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;cot&#39;</span>

    <span class="k">def</span> <span class="nf">as_oracle</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="n">template</span><span class="o">=</span><span class="s1">&#39;(1 / TAN(</span><span class="si">%(expressions)s</span><span class="s1">))&#39;</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">)</span></div>


<div class="viewcode-block" id="Degrees"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Degrees">[docs]</a><span class="k">class</span> <span class="nc">Degrees</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;DEGREES&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;degrees&#39;</span>

    <span class="k">def</span> <span class="nf">as_oracle</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span>
            <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span>
            <span class="n">template</span><span class="o">=</span><span class="s1">&#39;((</span><span class="si">%%</span><span class="s1">(expressions)s) * 180 / </span><span class="si">%s</span><span class="s1">)&#39;</span> <span class="o">%</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span>
            <span class="o">**</span><span class="n">extra_context</span>
        <span class="p">)</span></div>


<div class="viewcode-block" id="Exp"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Exp">[docs]</a><span class="k">class</span> <span class="nc">Exp</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;EXP&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;exp&#39;</span></div>


<div class="viewcode-block" id="Floor"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Floor">[docs]</a><span class="k">class</span> <span class="nc">Floor</span><span class="p">(</span><span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;FLOOR&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;floor&#39;</span></div>


<div class="viewcode-block" id="Ln"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Ln">[docs]</a><span class="k">class</span> <span class="nc">Ln</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;LN&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;ln&#39;</span></div>


<div class="viewcode-block" id="Log"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Log">[docs]</a><span class="k">class</span> <span class="nc">Log</span><span class="p">(</span><span class="n">FixDecimalInputMixin</span><span class="p">,</span> <span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;LOG&#39;</span>
    <span class="n">arity</span> <span class="o">=</span> <span class="mi">2</span>

    <span class="k">def</span> <span class="nf">as_sqlite</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">if</span> <span class="ow">not</span> <span class="nb">getattr</span><span class="p">(</span><span class="n">connection</span><span class="o">.</span><span class="n">ops</span><span class="p">,</span> <span class="s1">&#39;spatialite&#39;</span><span class="p">,</span> <span class="kc">False</span><span class="p">):</span>
            <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">)</span>
        <span class="c1"># This function is usually Log(b, x) returning the logarithm of x to</span>
        <span class="c1"># the base b, but on SpatiaLite it&#39;s Log(x, b).</span>
        <span class="n">clone</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
        <span class="n">clone</span><span class="o">.</span><span class="n">set_source_expressions</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">get_source_expressions</span><span class="p">()[::</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
        <span class="k">return</span> <span class="n">clone</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">)</span></div>


<div class="viewcode-block" id="Mod"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Mod">[docs]</a><span class="k">class</span> <span class="nc">Mod</span><span class="p">(</span><span class="n">FixDecimalInputMixin</span><span class="p">,</span> <span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;MOD&#39;</span>
    <span class="n">arity</span> <span class="o">=</span> <span class="mi">2</span></div>


<div class="viewcode-block" id="Pi"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Pi">[docs]</a><span class="k">class</span> <span class="nc">Pi</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;PI&#39;</span>
    <span class="n">arity</span> <span class="o">=</span> <span class="mi">0</span>

    <span class="k">def</span> <span class="nf">as_oracle</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span><span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="n">template</span><span class="o">=</span><span class="nb">str</span><span class="p">(</span><span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">),</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">)</span></div>


<div class="viewcode-block" id="Power"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Power">[docs]</a><span class="k">class</span> <span class="nc">Power</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Func</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;POWER&#39;</span>
    <span class="n">arity</span> <span class="o">=</span> <span class="mi">2</span></div>


<div class="viewcode-block" id="Radians"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Radians">[docs]</a><span class="k">class</span> <span class="nc">Radians</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;RADIANS&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;radians&#39;</span>

    <span class="k">def</span> <span class="nf">as_oracle</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span> <span class="o">**</span><span class="n">extra_context</span><span class="p">):</span>
        <span class="k">return</span> <span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">as_sql</span><span class="p">(</span>
            <span class="n">compiler</span><span class="p">,</span> <span class="n">connection</span><span class="p">,</span>
            <span class="n">template</span><span class="o">=</span><span class="s1">&#39;((</span><span class="si">%%</span><span class="s1">(expressions)s) * </span><span class="si">%s</span><span class="s1"> / 180)&#39;</span> <span class="o">%</span> <span class="n">math</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span>
            <span class="o">**</span><span class="n">extra_context</span>
        <span class="p">)</span></div>


<div class="viewcode-block" id="Round"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Round">[docs]</a><span class="k">class</span> <span class="nc">Round</span><span class="p">(</span><span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;ROUND&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;round&#39;</span></div>


<div class="viewcode-block" id="Sin"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Sin">[docs]</a><span class="k">class</span> <span class="nc">Sin</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;SIN&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;sin&#39;</span></div>


<div class="viewcode-block" id="Sqrt"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Sqrt">[docs]</a><span class="k">class</span> <span class="nc">Sqrt</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;SQRT&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;sqrt&#39;</span></div>


<div class="viewcode-block" id="Tan"><a class="viewcode-back" href="../../../../../ref/models/database-functions.html#django.db.models.functions.Tan">[docs]</a><span class="k">class</span> <span class="nc">Tan</span><span class="p">(</span><span class="n">NumericOutputFieldMixin</span><span class="p">,</span> <span class="n">Transform</span><span class="p">):</span>
    <span class="n">function</span> <span class="o">=</span> <span class="s1">&#39;TAN&#39;</span>
    <span class="n">lookup_name</span> <span class="o">=</span> <span class="s1">&#39;tan&#39;</span></div>
</pre></div>

          </div>
        </div>
      </div>
      
        
          <div class="yui-b" id="sidebar">
            
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../../../../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
              <h3>Last update:</h3>
              <p class="topless">Mar 04, 2020</p>
          </div>
        
      
    </div>

    <div id="ft">
      <div class="nav">
    <a href="../../../../index.html" title="Module code" accesskey="U">up</a></div>
    </div>
  </div>

      <div class="clearer"></div>
    </div>
  </body>
</html>